<template>
  <wd-cell prop="fileList" :rules="[{ required: true, validator, message: '请上传图片' }]">
    <view class="flex flex-justify-between w-90vw m-3">
      <view>
        <text class="text-lg font-size-30rpx font-800 mr-1">标题</text>
        <wd-popover content="这是一段信息。">
          <wd-icon name="warn-bold" color="#2874ce" size="30rpx"></wd-icon>
        </wd-popover>
      </view>
      <view>
        <wd-icon name="view-list" size="30rpx"></wd-icon>
      </view>
    </view>
    <slot></slot>
  </wd-cell>
</template>

<script lang="ts" setup>
const validator = (val, data) => {
  if (JSON.stringify(val) !== '[]') {
    return Promise.resolve()
  } else {
    return Promise.reject(data.message)
  }
}
</script>

<style lang="scss" scoped></style>
